home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 013a / font_m21.zip / ASM_DEMO.ASM < prev    next >
Assembly Source File  |  1991-08-01  |  3KB  |  74 lines

  1. ;------------------------------------------------------------
  2. ; Sample assembly file.
  3. ;------------------------------------------------------------
  4.  
  5. ;---------------------------------------------------------------------------
  6. ;   Font is saved in the filenamed DEMO.PAS.  To use the font, you must call
  7. ;   interrupt 10h, function 11h, sub-function 10h to load up the font.
  8. ;   
  9. ;   The following are the parameter needed to call the function:
  10. ;  
  11. ;                 AX  =  1110H      (ah = 11H, al = 10H)
  12. ;          BH  =  bytes per character 
  13. ;          BL  =  block to load to.  (use 0)
  14. ;          CX  =  number of character defined by table
  15. ;          DX  =  starting character value
  16. ;          ES  =  segment of the table (use Seg())
  17. ;          BP  =  offset of the table (use Ofs())
  18. ;
  19. ;   Notice:  You should always upload the character immediately after set
  20. ;            the Video mode.  Also you must make sure that page 0 is active.
  21. ;        If it is not call immediately after the video mode set, some
  22. ;        side effects may occur.  I had experience some palette errors
  23. ;        my self, when I call this function with out changing video 
  24. ;        mode.  This doesn't happen all the time, however.  But be on 
  25. ;        the safe side is the best.   
  26. ;   
  27. ;   FONT MANIA will supply you with the height of the font.  It is defined
  28. ;   by your label name with "_POINTS" added at the end of the string.  For
  29. ;   example, if your label reference is call DEMO, then DEMO_POINTS will 
  30. ;   represent the byte-per-character of the font (the height of the font).
  31. ;   
  32. ;   Set the CX to 256 if you want to upload the whole font.   If you want to 
  33. ;   only upload part of font.  Set CX to whatever number of the character 
  34. ;   you want to upload, and set DX to the first character you want to upload.
  35. ;   
  36. ;   For example, suppose you want to upload the character 65 to 88, 
  37. ;   ('A' to 'Z') and the label reference is DEMO.  Here are the parameter
  38. ;   needed:
  39. ;   
  40. ;         AX  =  1110h
  41. ;         BH  =  DEMO_POINTS
  42. ;         BL  =  0
  43. ;         CX  =  24               ( 24 characters to load )
  44. ;         DX  =  65               ( first character to load )
  45. ;         ES  =  SEGMENT DEMO
  46. ;         BP  =  OFFSET DEMO
  47. ;         
  48. ;   See below for examples of how to set the registers. 
  49. ;----------------------------------------------------------------------------         
  50.  
  51. code    segment    para
  52.     org    100h
  53.  
  54. start:
  55.     mov    ax, 3            ; set the SCREEN MODE first
  56.     int    10h
  57.  
  58.     mov    ax, 1110h        ; use USER's FONT upload function
  59.     mov    bh, DEMO_POINTS        ; get the bytes per character in bh
  60.                     ; FONT MANIA will provided the font
  61.                     ; height.  LABEL_POINTS.
  62.     xor    bl, bl            ; load to character block 0
  63.     mov    cx, 256            ; load all 256 character
  64.     xor    dx, dx            ; begin with character 0 (ascii NULL)
  65.     mov    bp, offset DEMO        ; address of the font.  LABEL
  66.     int    10h            ; upload it
  67.     
  68.     int    20h            ; terminate the program
  69.  
  70. include    demo.asm            ; the font data.
  71.  
  72. code    ends
  73.  
  74.     end    start            ; end of file / starting point